import request from '@/utils/request'

/**
 * 字典
 */
export function getDictByCode(dictCode) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/sysDictionary/getDictByCode',
    method: 'POST',
    data: { dictCode }
  })
}

export function queryPage(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/exchangeCoupon/queryPage',
    method: 'post',
    data
  })
}

/**
 * 查询详情
 * @param {*} id
 */
export function get(id) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/exchangeCoupon/get',
    method: 'get',
    params: { id }
  })
}

/**
 * 添加
 * @param {*} data
 */
export function insert(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/exchangeCoupon/insert',
    method: 'post',
    data
  })
}

/**
 * 编辑
 * @param {*} data
 */
export function update(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/exchangeCoupon/update',
    method: 'post',
    data
  })
}
/**
 * 提交审核
 * @param {*} data
 */
export function check(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/exchangeCoupon/submitVerify',
    method: 'post',
    data
  })
}
/**
 * 同步审核结果
 * @param {*} data
 */
export function syncCheck(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/exchangeCoupon/syncVerifyResult',
    method: 'post',
    data
  })
}
/**
 * 停用
 * @param {*} data
 */
export function disabled(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/exchangeCoupon/stop',
    method: 'post',
    data
  })
}

/**
 * 删除
 * @param {*} id
 */
export function del(id) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/exchangeCoupon/deleteById',
    method: 'get',
    params: { id }
  })
}
